package com.junfeng.pet2048.controller;

import com.junfeng.pet2048.constant.SCProtocol;
import com.junfeng.pet2048.server.WebSocketServer;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class TestController {

    @Resource
    private WebSocketServer webSocketServer;

    @GetMapping("/test")
    public String sendMessageTo(){

        webSocketServer.responseToClient(SCProtocol.HEART_BEAT, "xiejianmin",  200,  "http 推送消息");

        return "success";

    }

}
